/*
 * @Author: chenhuanhuan 2925102113@qq.com
 * @Date: 2024-12-25 12:15:09
 * @LastEditors: wuheng wuheng@szhbzc.com
 * @LastEditTime: 2025-02-21 16:22:28
 * @FilePath: \hbzc-groupmeal-center-web\src\api\Recipe.ts
 */

import request from "@/utils/newrequst";
import qs from "qs";

// 获取周菜谱开始日期
export const getRecipeBegin = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/params`, method: "post", data: data,
  });
};
// 设置周菜谱开始日期
export const setRecipeBegin = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/params-edit`, method: "post", data: data,
  });
};
// 查询食谱统计数据

export const getRecipePlan = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/plans`, method: "post", data
  });
};
// 查询菜谱统计数据
export const getRecipePlanStatistic = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/plan-statistic`, method: "post", data
  });
};

export const getRecipeDefaultTemplate = (data: any) => {
  return request({
    url: `/recipe/v1/center/recipe/default-template`, method: "post", data
  });
};
// 查询菜谱生成模板参数-聚合依赖参数
export const getRecipeBaseData = (data: any = {}) => {
  return request({
    url: `/recipe/v1/kitchen/recipe/template-base-data`, method: "post", data
  });
};
// 撤销审核 /api
// 菜谱参数查询
export const getRecipePlanRevoke = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/plan-revoke`, method: "post", data
  });
};
export const getRecipeParams = (data: any = {}) => {
  return request({
    url: `/recipe/v1/kitchen/recipe/params`, method: "post", data
  });
};
// 获取菜谱详情
export const getRecipePlanDetail = (data: any) => {
  return request({
    url: `/recipe/v1/center/recipe/plan-detail`, method: "post", data
  });
};
// 按餐修改菜谱(修改份数、替换位置、添加菜、清空一餐的菜)
export const getRecipePlanUpdate = (data: any) => {
  return request({
    url: `/recipe/v1/kitchen/recipe/plan-update`, method: "post", data
  });
};
// 菜品分类树结构
export const getDishTypeTree = (data: any) => {
  return request({
    url: `/base/v1/public/dish-type/tree`, method: "post", data
  });
}
// 分页查询菜肴
export const getCanteenDishPage = (data: any) => {
  return request({
    url: `/base/v1/canteen/dish/page`, method: "post", data
  });
};
// 查询菜谱评估数据
export const getRecipePlanAssessment = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/plan-assessment`, method: "post", data
  });
};
// 查询菜谱生成模板参数-按周
export const getRecipeTemplate = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/template`, method: "post", data: data,
  });
};
// 保存菜谱生成模板参数-按周
export const setRecipeTemplate = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/template-edit`, method: "post", data: data,
  });
};


// 查询菜谱生成模板参数-按天
export const getRecipeTemplateDay = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/template-day`, method: "post", data: data,
  });
};

// 保存菜谱生成模板参数-按天
export const setRecipeTemplateDay = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/template-edit-day`, method: "post", data: data,
  });
};
// 查询菜谱生成模板参数-聚合依赖参数
export const getTemplatePramas = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/template-base-data`, method: "post", data: data,
  });
};
// 查询菜谱生成模板参数-聚合依赖参数
export const getRecipePlanList = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/plans`, method: "post", data: data,
  });
};

// 获取食堂菜谱投产比区间
export const getParamsRatio = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/params-roi`, method: "post", data: data,
  });
};

//设置食堂菜谱投产比区间
export const setRatio = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/params-roi-edit`, method: "post", data: data,
  });
};
// 菜谱批量撤销
export const PlanRecipeRevokeBatchApi = (data: any = {}) => {
  return request({
    url: `/recipe/v1/center/recipe/plan-batch-revoke`, method: "post", data: data,
  });
};


//查询采购参数
export const getParamSetting = (data: any = {}) => {
  return request({
    url: `/base/v1/public/param-setting/list`, method: "post", data: data,
  });
};


//批量修改采购参数
export const setAllPrams = (data: any = {}) => {
  return request({
    url: `/base/v1/public/param-setting/batch-edit`, method: "post", data: JSON.stringify(data),
  });
};






